﻿@model HeaderLinksModel
@using Nop.Web.Models.Common;

<div class="shop-menu pull-right">
    @*<ul class="nav navbar-nav">
            <li><a href="#"><i class="fa fa-user"></i> Account</a></li>
            <li><a href="#"><i class="fa fa-star"></i> Wishlist</a></li>
            <li><a href="checkout.html"><i class="fa fa-crosshairs"></i> Checkout</a></li>
            <li><a href="cart.html"><i class="fa fa-shopping-cart"></i> Cart</a></li>
            <li><a href="login.html"><i class="fa fa-lock"></i> Login</a></li>
        </ul>*@
    <ul class="nav navbar-nav">

        @Html.Action("AdminHeaderLinks", "Common")
        @if (Model.IsAuthenticated)
        {
            <li><a href="@Url.RouteUrl("CustomerInfo")"><i class="fa fa-user"></i> @Model.CustomerEmailUsername</a></li>
            <li><a href="@Url.RouteUrl("Logout")"><i class="fa fa-power-off"></i> @T("Account.Logout")</a></li>
        }
        else
        {
            <li><a href="@Url.RouteUrl("Register")"><i class="fa fa-cog"></i> @T("Account.Register")</a></li>
            <li><a href="@Url.RouteUrl("Login")"><i class="fa fa-power-off"></i> @T("Account.Login")</a></li>
        }
        @if (Model.AllowPrivateMessages)
        {
            <li>
                <a href="@Url.RouteUrl("PrivateMessages", new { tab = "" })"><i class="fa fa-envelope"></i> @T("PrivateMessages.Inbox")</a>
                @Model.UnreadPrivateMessages
            </li>
            if (!string.IsNullOrEmpty(Model.AlertMessage))
            {
                <script type="text/javascript">
                    $(document).ready(function () {
                        displayPopupNotification('@Html.Raw(HttpUtility.JavaScriptStringEncode(Model.AlertMessage))', 'success', false);
                    });
                </script>
            }
        }
        @if (Model.ShoppingCartEnabled)
        {
            <li id="topcartlink" class="dropdown">


                @if (!String.IsNullOrWhiteSpace(@Html.Action("FlyoutShoppingCart", "ShoppingCart").ToString()))
                {
                    <a href="@Url.RouteUrl("ShoppingCart")" class="ico-cart dropdown-toggle minicart-anchor" data-toggle="dropdown" data-hover="dropdown">
                        <span class="cart-label"><i class="fa fa-shopping-cart"></i> @T("ShoppingCart")</span>
                        <span class="cart-qty">@T("ShoppingCart.HeaderQuantity", Model.ShoppingCartItems)</span>
                        <i class="fa fa-angle-down"></i>

                    </a>



                    <ul class="minicart-dropdown-menu dropdown">
                        <li>@Html.Action("FlyoutShoppingCart", "ShoppingCart")</li>

                    </ul>


                }
                else
                {
                    <a href="@Url.RouteUrl("ShoppingCart")" class="ico-cart">
                        <span class="cart-label"><i class="fa fa-shopping-cart"></i> @T("ShoppingCart")</span>
                        <span class="cart-qty">@T("ShoppingCart.HeaderQuantity", Model.ShoppingCartItems)</span>


                    </a>

                }


            </li>

        }
        @if (Model.WishlistEnabled)
        {
            <li>
                <a href="@Url.RouteUrl("Wishlist")" class="ico-wishlist">
                    <span class="cart-label"><i class="fa fa-star"></i> @T("Wishlist")</span>
                    <span class="wishlist-qty">@T("Wishlist.HeaderQuantity", Model.WishlistItems)</span>
                </a>
            </li>
        }



    </ul>
</div>






@if (Model.ShoppingCartEnabled)
{
    <script type="text/javascript">
        $(document).ready(function () {

            if ($(window).innerWidth() > 768) {
                $('.top-menu').on('mouseenter', '#topcartlink', function () {
                    $('#flyout-cart').addClass('active');

                });
                $('.top-menu').on('mouseleave', '#topcartlink', function () {
                    $('#flyout-cart').removeClass('active');

                });
                $('.top-menu').on('mouseenter', '#flyout-cart', function () {
                    $('#flyout-cart').addClass('active');
                });
                $('.top-menu').on('mouseleave', '#flyout-cart', function () {
                    $('#flyout-cart').removeClass('active');
                });
            }

            $('ul.minicart-dropdown-menu li').slimScroll({
                color: '#FE980F',
                size: '10px',
                height: '400px'
            });
        });
    </script>
}

